Skip to content

[vote] Models changes for new vote service - #575

Merged
ostcar merged 15 commits into
OpenSlides:feature/votefrom
ostcar:poll-option-user
Aug 31, 2026
Merged

ostcar merged 15 commits into
OpenSlides:feature/votefrom
ostcar:poll-option-user

Conversation

@ostcar

@ostcar ostcar commented Aug 20, 2026

Copy link
Copy Markdown
Member

@bastianjoel Do you need changes on the client?

@ostcar
ostcar requested a review from bastianjoel August 20, 2026 12:52
@bastianjoel

Copy link
Copy Markdown
Member

Yes, quite a lot.

@ostcar

ostcar commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

@ostcar

ostcar commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

@vkrasnovyd Do we need an update for the backend as well?

@vkrasnovyd

Copy link
Copy Markdown
Contributor

Minor: re-generating the models and adjusting some tests. Will do today.

@ostcar

ostcar commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

Please wait one moment. We want to change the model again. We want to have both, meeting_user_id an user_id. If you do not have a meeting_user in the migration, its ok to only write user_id.

Please also check, that if a meeting_user gets deleted, it does not delete the poll_option, but only the field meeting_user_id.

We want to do the same for poll_ballot_user. The meeting_user fields will be optional and the user-field is required. If the backen removes a meeting_user, it should not delete the poll_ballot_user, but only clear the field meeting_user (for acting_user and represented_user).

@vkrasnovyd

Copy link
Copy Markdown
Contributor

Please also check, that if a meeting_user gets deleted, it does not delete the poll_option, but only the field meeting_user_id.

It should be defined in meta, in meeting_user.yml. These 3 fields need to have on_delete: SET_NULL:

  • poll_option_ids
  • acting_ballot_ids
  • represented_ballot_ids

@ostcar

ostcar commented Aug 21, 2026

Copy link
Copy Markdown
Member Author

I added all models changes, that we have discussed yesterday in here, so we can fix them in the services without merge conflicts.

@ostcar
ostcar requested a review from vkrasnovyd August 21, 2026 07:49
@ostcar ostcar changed the title Move poll_option from meeting_user to user [vote] Models changes for new vote service Aug 21, 2026
Comment thread collections/history_entry.yml Resolved
@vkrasnovyd

Copy link
Copy Markdown
Contributor

@ostcar as far as I understood, according to the new concept poll/entitled_users_at_stop should be migrated (or kept). Is it so? Will the field name change to just entitled_users?

@ostcar

ostcar commented Aug 21, 2026

Copy link
Copy Markdown
Member Author

The current value of entitled_users_at_stop is json:

entitled_users_at_stop:
type: JSON
restriction_mode: A

I don't know the format of it. In the new system, it is a list of numbers (a relation-list field)

@ostcar

ostcar commented Aug 21, 2026

Copy link
Copy Markdown
Member Author

os-go, autoupdate and vote service are ready.

@bastianjoel and @vkrasnovyd pls tell, when the other services are ready, and we can merge this into the feature/vote branch

@vkrasnovyd

Copy link
Copy Markdown
Contributor

backend will be ready in the first half of next week.

@ostcar

ostcar commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

@bastianjoel and @vkrasnovyd Here are the changes as discussed

Comment thread collections/poll_entitled_user.yml Resolved
Comment thread collections/meeting_user.yml Resolved
Comment on lines +19 to +23
content_object_id:
type: generic-relation
reference:
- meeting_user
- user

@vkrasnovyd vkrasnovyd Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. During migration: if meeting_user exists, use it, if not - use user.
  2. On meeting_user delete - change relation to user.
  3. On meeting_user create if user has poll_options in the polls of the corresponding meeting - don't change content_object_id from user to the new meeting_user.

Is it correct?

@bastianjoel bastianjoel Aug 26, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. You can just always use the user if it is easier.

Comment thread collections/meeting_user.yml Resolved
ostcar and others added 3 commits August 27, 2026 12:41
Co-authored-by: Bastian Rihm <me@bastianjoel.de>
Co-authored-by: Bastian Rihm <me@bastianjoel.de>
Comment thread collections/meeting_user.yml Resolved
@ostcar

ostcar commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

@bastianjoel bastianjoel removed their assignment Aug 28, 2026
@vkrasnovyd

Copy link
Copy Markdown
Contributor

Added on_delete to 2 fields:

  • meeting_user/poll_option_ids: PROTECT - suggestion from @ostcar from this week's meeting
  • poll/entitled_user_ids: CASCADE - needed for backend

@vkrasnovyd

Copy link
Copy Markdown
Contributor

backend: OpenSlides/openslides-backend#3734

@bastianjoel

Copy link
Copy Markdown
Member

client: OpenSlides/openslides-client#6529

@ostcar
ostcar merged commit a709382 into OpenSlides:feature/vote Aug 31, 2026
2 checks passed
@ostcar
ostcar deleted the poll-option-user branch August 31, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants